how to find keyword in script using python beautifulsoup?

by: vipulGangwar, 7 years ago


<script type="text/javascript">
    var _gaq = _gaq || [];
   _gaq.push(['_setAccount', 'UA-25937010-1']);
   _gaq.push(['_trackPageview']);

  (function() {
  var ga = document.createElement('script'); ga.type =
  'text/javascript'; ga.async = true;
  ga.src = ('https:' == document.location.protocol ? 'https://ssl' :
  'http://www') + '.google-analytics.com/ga.js';
  var s = document.getElementsByTagName('script')[0];
  s.parentNode.insertBefore(ga, s);
  })();
  </script>


This is my script code and I want to check 'UA-25937010-1' keyword



You must be logged in to post. Please login or register an account.



Beautiful soup helps you to parse HTML. From there, if it's not a tag, then you can just ruse regular expressions: https://pythonprogramming.net/regular-expressions-regex-tutorial-python-3/

-Harrison 7 years ago

You must be logged in to post. Please login or register an account.